from sklearn.feature_extraction.text import TfidfVectorizer

corpus = ["我爱北京天安门", "天安门上太阳升", "伟大领袖毛主席"]
vectorizer = TfidfVectorizer(min_df=1)
model = vectorizer.fit_transform(corpus)
print(model)
print(model.todense().round(2))

